
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.SystemColor;
import java.awt.Toolkit;
import java.awt.color.ColorSpace;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFormattedTextField;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.SwingConstants;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.BorderUIResource;

import java.awt.GridLayout;
import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
import java.awt.Window.Type;
import java.util.ArrayList;
import javax.swing.UIManager;
import javax.swing.border.EtchedBorder;
import javax.swing.JTable;
import javax.swing.border.BevelBorder;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;

public class Admin_test extends JFrame {
	private int a, r, l, t;
	int p = 0;
	Toolkit tk = getToolkit();
	private JPanel contentPane, panel_2, panel_1;
	JList list;
	private JPasswordField passwordField;
	private JPanel panel_3, panel_4;
	private JLabel reihe;
	private Dimension d = new Dimension(49, 53);
	private JButton but;
	private final ButtonGroup buttonGroup = new ButtonGroup();
	public ArrayList<JButton> array;
	private Color gruen = new Color(0, 160, 0);
	private Color col = UIManager.getColor("Button.background");
	private Color col_w = Color.white;
	private Color col_b = Color.black;
	private Color col_gray = Color.DARK_GRAY;
	private Color col_lg = Color.DARK_GRAY;
	private Color gelb = new Color(255, 255, 0);

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Admin_test frame = new Admin_test();
					frame.setVisible(true);

					frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 * 
	 * @param string
	 */
	public Admin_test() {
		super("Take-a-Seat!");
		a = 0;
		r = 1;
		t = 1;
		l = 0;
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 1200, 800);
		
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		JMenu mnDatei = new JMenu("Datei");
		menuBar.add(mnDatei);
		
		JMenuItem mntmVeranstaltungAnlegen = new JMenuItem("Veranstaltung anlegen");
		mnDatei.add(mntmVeranstaltungAnlegen);
		
		JMenuItem mntmFilmAnlegen = new JMenuItem("Film anlegen");
		mnDatei.add(mntmFilmAnlegen);
		
		JMenuItem mntmBenutzerAnlegen = new JMenuItem("Benutzer anlegen");
		mnDatei.add(mntmBenutzerAnlegen);
		contentPane = new JPanel();
		contentPane.setBackground(new Color(191, 205, 219));
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		panel_3 = new JPanel();
		panel_3.setLayout(new GridLayout(5, 16, 5, 10));
		panel_4 = new JPanel();
		panel_4.setBackground(SystemColor.activeCaption);
		panel_4.setLayout(new GridLayout(3, 15, 5, 10));
		array = new ArrayList<JButton>();
		JPanel panel = new JPanel();
		panel.setBackground(Color.RED);

		for (int r = 1; r < 6; r++) {

			reihe = new JLabel();
			reihe.setText("Reihe" + r);
			reihe.setFont(new Font("Verdana", Font.BOLD, 12));
			reihe.setToolTipText("Reihe" + r);

			for (int i = 1; i < 16; i++) {

				final JButton tb = new JButton();
				tb.setName("Reihe: " + r + " Platz: " + i);
				tb.setBackground(gruen);
				tb.setForeground(col_w);
				tb.setFont(new Font("Verdana", Font.BOLD, 12));
				tb.setBorder(BorderFactory.createLineBorder(col_lg, 3));
				tb.setLabel("" + i);
				tb.setFocusable(false);
				tb.setToolTipText("Reihe: " + r + " Platz: " + i);

				tb.addMouseListener(new MouseAdapter() {
					@Override
					public void mouseClicked(MouseEvent arg0) {

						if (a < p && tb.getBackground() != col_gray) {

							((DefaultListModel) list.getModel()).addElement(tb
									.getName());
							array.add(tb);
							tb.setBackground(col_gray);
							tb.setForeground(col_w);
							tb.setBorder(BorderFactory.createLineBorder(col_w,
									3));
							a++;
						}

						else if (tb.getBackground() == col_gray && a > 0) {

							tb.setBackground(gruen);
							tb.setForeground(col_w);
							((DefaultListModel) list.getModel())
									.removeElement(tb.getName());
							t = array.indexOf(tb);
							array.remove(t);
							tb.setBorder(BorderFactory.createLineBorder(col_b,
									3));
							a--;
						}

					}

					@Override
					public void mouseEntered(MouseEvent e) {
						if (tb.getBackground() != col_gray)
							tb.setBorder(BorderFactory.createLineBorder(col_w,
									3));
						else
							tb.setBorder(BorderFactory.createLineBorder(col_b,
									3));

					}

					@Override
					public void mouseExited(MouseEvent e) {
						if (tb.getBackground() != col_gray)
							tb.setBorder(BorderFactory.createLineBorder(col_lg,
									3));
						else
							tb.setBorder(BorderFactory.createLineBorder(col_w,
									3));

					}

				}

				);
				panel_3.add(tb);
				panel_3.add(reihe);
			}
		}

		for (int r = 6; r < 9; r++) {

			reihe = new JLabel();
			reihe.setText("Reihe" + r);
			reihe.setFont(new Font("Verdana", Font.BOLD, 12));
			reihe.setToolTipText("Reihe" + r);

			for (int i = 1; i < 16; i++) {

				final JButton tb = new JButton();
				tb.setName("Reihe: " + r + " Platz: " + i);
				tb.setBackground(gruen);
				tb.setForeground(col_w);
				tb.setFont(new Font("Verdana", Font.BOLD, 12));
				tb.setBorder(BorderFactory.createLineBorder(col_lg, 3));
				tb.setLabel("" + i);
				tb.setFocusable(false);
				tb.setToolTipText("Reihe: " + r + " Platz: " + i);

				tb.addMouseListener(new MouseAdapter() {

					@Override
					public void mouseClicked(MouseEvent arg0) {

						if (a < p && tb.getBackground() != col_gray) {

							((DefaultListModel) list.getModel()).addElement(tb
									.getName());
							array.add(tb);
							tb.setBackground(col_gray);
							tb.setForeground(col_w);
							tb.setBorder(BorderFactory.createLineBorder(col_w,
									3));
							a++;
						}

						else if (tb.getBackground() == col_gray && a > 0) {

							tb.setBackground(gruen);
							tb.setForeground(col_w);
							((DefaultListModel) list.getModel())
									.removeElement(tb.getName());
							t = array.indexOf(tb);
							array.remove(t);
							tb.setBorder(BorderFactory.createLineBorder(col_b,
									3));
							a--;
						}

					}

					@Override
					public void mouseEntered(MouseEvent e) {
						if (tb.getBackground() != col_gray)
							tb.setBorder(BorderFactory.createLineBorder(col_w,
									3));
						else
							tb.setBorder(BorderFactory.createLineBorder(col_b,
									3));

					}

					@Override
					public void mouseExited(MouseEvent e) {
						if (tb.getBackground() != col_gray)
							tb.setBorder(BorderFactory.createLineBorder(col_lg,
									3));
						else
							tb.setBorder(BorderFactory.createLineBorder(col_w,
									3));

					}

				}

				);
				panel_4.add(tb);
				panel_4.add(reihe);
			}
		}
		JSeparator separator = new JSeparator();
		separator.setOrientation(SwingConstants.VERTICAL);

		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);

		panel_3.setBackground(SystemColor.activeCaption);

		JLabel label_1 = new JLabel("Parkett");
		label_1.setToolTipText("Parkett");
		label_1.setFont(new Font("Verdana", Font.BOLD, 16));
		label_1.setBackground(SystemColor.textHighlight);

		JLabel label_2 = new JLabel("Legende");
		label_2.setToolTipText("Legende zu den Sitzpl\u00E4tzen");
		label_2.setFont(new Font("Verdana", Font.BOLD, 16));

		JPanel panel_5 = new JPanel();
		panel_5.setBorder(new BevelBorder(BevelBorder.RAISED, Color.BLACK,
				null, null, null));
		panel_5.setBackground(SystemColor.inactiveCaption);

		JButton button = new JButton("= FREI");
		button.setToolTipText("Sitzplatz ist frei");
		button.setForeground(Color.WHITE);
		button.setFont(new Font("Verdana", Font.BOLD, 10));
		button.setFocusable(false);
		button.setBackground(new Color(0, 160, 0));

		JButton button_1 = new JButton("= RESERVIERT");
		button_1.setToolTipText("Sitzplatz ist reserviert");
		button_1.setForeground(Color.WHITE);
		button_1.setFont(new Font("Verdana", Font.BOLD, 10));
		button_1.setFocusable(false);
		button_1.setBackground(Color.DARK_GRAY);

		JButton btnVergeben = new JButton("= VERGEBEN");
		button_1.setToolTipText("Sitzplatz ist vergeben");
		btnVergeben.setForeground(col_b);
		btnVergeben.setFont(new Font("Verdana", Font.BOLD, 10));
		btnVergeben.setFocusable(false);
		btnVergeben.setBackground(gelb);

		JButton btnGesperrt = new JButton("= GESPERRT");
		btnGesperrt.setToolTipText("Sitzplatz ist gesperrt");
		btnGesperrt.setForeground(Color.WHITE);
		btnGesperrt.setFont(new Font("Verdana", Font.BOLD, 10));
		btnGesperrt.setFocusable(false);
		btnGesperrt.setBackground(Color.red);
		
		
		GroupLayout gl_panel_5 = new GroupLayout(panel_5);
		gl_panel_5.setHorizontalGroup(gl_panel_5.createParallelGroup(
				Alignment.LEADING).addGroup(
				Alignment.TRAILING,
				gl_panel_5
						.createSequentialGroup()
						.addContainerGap(41, Short.MAX_VALUE)
						.addComponent(button, GroupLayout.PREFERRED_SIZE, 85,
								GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(button_1, GroupLayout.PREFERRED_SIZE,
								127, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(btnVergeben)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(btnGesperrt, GroupLayout.PREFERRED_SIZE,
								134, GroupLayout.PREFERRED_SIZE)));
		gl_panel_5.setVerticalGroup(gl_panel_5.createParallelGroup(
				Alignment.LEADING).addGroup(
				gl_panel_5
						.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnGesperrt, GroupLayout.PREFERRED_SIZE,
								58, GroupLayout.PREFERRED_SIZE)
						.addComponent(btnVergeben, GroupLayout.PREFERRED_SIZE,
								58, GroupLayout.PREFERRED_SIZE)
						.addComponent(button_1, GroupLayout.DEFAULT_SIZE, 58,
								Short.MAX_VALUE)
						.addComponent(button, GroupLayout.DEFAULT_SIZE, 58,
								Short.MAX_VALUE)));
		panel_5.setLayout(gl_panel_5);

		JLabel label_3 = new JLabel("Loge");
		label_3.setToolTipText("Loge");
		label_3.setFont(new Font("Verdana", Font.BOLD, 16));
		label_3.setBackground(Color.DARK_GRAY);

		GroupLayout gl_contentPane = new GroupLayout(contentPane);
		gl_contentPane
				.setHorizontalGroup(gl_contentPane
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								gl_contentPane
										.createSequentialGroup()
										.addGroup(
												gl_contentPane
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																gl_contentPane
																		.createSequentialGroup()
																		.addComponent(
																				panel,
																				GroupLayout.DEFAULT_SIZE,
																				846,
																				Short.MAX_VALUE)
																		.addGap(6))
														.addGroup(
																Alignment.TRAILING,
																gl_contentPane
																		.createSequentialGroup()
																		.addContainerGap()
																		.addGroup(
																				gl_contentPane
																						.createParallelGroup(
																								Alignment.TRAILING)
																						.addComponent(
																								panel_4,
																								Alignment.LEADING,
																								GroupLayout.DEFAULT_SIZE,
																								795,
																								Short.MAX_VALUE)
																						.addComponent(
																								panel_3,
																								Alignment.LEADING,
																								GroupLayout.DEFAULT_SIZE,
																								795,
																								Short.MAX_VALUE)
																						.addGroup(
																								gl_contentPane
																										.createSequentialGroup()
																										.addGroup(
																												gl_contentPane
																														.createParallelGroup(
																																Alignment.LEADING)
																														.addGroup(
																																Alignment.TRAILING,
																																gl_contentPane
																																		.createSequentialGroup()
																																		.addComponent(
																																				label_3,
																																				GroupLayout.PREFERRED_SIZE,
																																				59,
																																				GroupLayout.PREFERRED_SIZE)
																																		.addPreferredGap(
																																				ComponentPlacement.RELATED,
																																				175,
																																				Short.MAX_VALUE)
																																		.addComponent(
																																				label_2,
																																				GroupLayout.PREFERRED_SIZE,
																																				76,
																																				GroupLayout.PREFERRED_SIZE))
																														.addComponent(
																																label_1,
																																GroupLayout.PREFERRED_SIZE,
																																89,
																																GroupLayout.PREFERRED_SIZE))
																										.addPreferredGap(
																												ComponentPlacement.RELATED)
																										.addComponent(
																												panel_5,
																												GroupLayout.PREFERRED_SIZE,
																												481,
																												GroupLayout.PREFERRED_SIZE)))
																		.addGap(47)))
										.addComponent(separator,
												GroupLayout.PREFERRED_SIZE,
												GroupLayout.DEFAULT_SIZE,
												GroupLayout.PREFERRED_SIZE)
										.addGap(10)
										.addComponent(tabbedPane,
												GroupLayout.PREFERRED_SIZE,
												GroupLayout.DEFAULT_SIZE,
												GroupLayout.PREFERRED_SIZE)));
		gl_contentPane
				.setVerticalGroup(gl_contentPane
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								gl_contentPane
										.createSequentialGroup()
										.addComponent(panel,
												GroupLayout.PREFERRED_SIZE, 30,
												GroupLayout.PREFERRED_SIZE)
										.addGap(18)
										.addComponent(panel_3,
												GroupLayout.PREFERRED_SIZE,
												354, GroupLayout.PREFERRED_SIZE)
										.addGroup(
												gl_contentPane
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																gl_contentPane
																		.createSequentialGroup()
																		.addGap(6)
																		.addGroup(
																				gl_contentPane
																						.createParallelGroup(
																								Alignment.LEADING)
																						.addGroup(
																								gl_contentPane
																										.createSequentialGroup()
																										.addPreferredGap(
																												ComponentPlacement.RELATED)
																										.addComponent(
																												label_1,
																												GroupLayout.PREFERRED_SIZE,
																												27,
																												GroupLayout.PREFERRED_SIZE))
																						.addGroup(
																								gl_contentPane
																										.createSequentialGroup()
																										.addGap(14)
																										.addComponent(
																												panel_5,
																												GroupLayout.PREFERRED_SIZE,
																												62,
																												GroupLayout.PREFERRED_SIZE)))
																		.addGap(9))
														.addGroup(
																gl_contentPane
																		.createSequentialGroup()
																		.addPreferredGap(
																				ComponentPlacement.RELATED,
																				GroupLayout.DEFAULT_SIZE,
																				Short.MAX_VALUE)
																		.addComponent(
																				label_2,
																				GroupLayout.PREFERRED_SIZE,
																				36,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(22)))
										.addPreferredGap(
												ComponentPlacement.RELATED)
										.addComponent(panel_4,
												GroupLayout.PREFERRED_SIZE,
												198, GroupLayout.PREFERRED_SIZE)
										.addGap(73))
						.addComponent(separator, Alignment.TRAILING,
								GroupLayout.DEFAULT_SIZE, 746, Short.MAX_VALUE)
						.addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE,
								740, GroupLayout.PREFERRED_SIZE)
						.addGroup(
								Alignment.TRAILING,
								gl_contentPane
										.createSequentialGroup()
										.addContainerGap(460, Short.MAX_VALUE)
										.addComponent(label_3,
												GroupLayout.PREFERRED_SIZE, 27,
												GroupLayout.PREFERRED_SIZE)
										.addGap(277)));

		JLabel label = new JLabel("Leinwand");
		label.setFont(new Font("Tahoma", Font.BOLD, 22));
		label.setHorizontalTextPosition(SwingConstants.CENTER);
		label.setHorizontalAlignment(SwingConstants.CENTER);
		label.setForeground(Color.WHITE);
		label.setDisplayedMnemonic('c');
		label.setBackground(Color.RED);
		panel.add(label);

		final JTabbedPane tabbedPane_2 = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane.addTab("Administrator", null, tabbedPane_2, null);

		panel_1 = new JPanel();
		tabbedPane_2.addTab("Login", null, panel_1, null);

		JFormattedTextField formattedTextField = new JFormattedTextField();

		passwordField = new JPasswordField();

		JLabel lblBenutzer = new JLabel("Benutzer");

		JLabel lblPassword = new JLabel("Password:");

		JButton btnLogin = new JButton("Login");
		btnLogin.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				p = 120;
				tabbedPane_2.remove(panel_1);
				tabbedPane_2.setEnabledAt(0, true);

			}
		});
		GroupLayout gl_panel_1 = new GroupLayout(panel_1);
		gl_panel_1
				.setHorizontalGroup(gl_panel_1
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								gl_panel_1
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												gl_panel_1
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																gl_panel_1
																		.createSequentialGroup()
																		.addGroup(
																				gl_panel_1
																						.createParallelGroup(
																								Alignment.LEADING)
																						.addComponent(
																								lblPassword,
																								GroupLayout.PREFERRED_SIZE,
																								71,
																								GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								lblBenutzer,
																								GroupLayout.PREFERRED_SIZE,
																								55,
																								GroupLayout.PREFERRED_SIZE))
																		.addGap(18)
																		.addGroup(
																				gl_panel_1
																						.createParallelGroup(
																								Alignment.LEADING)
																						.addComponent(
																								passwordField,
																								GroupLayout.DEFAULT_SIZE,
																								171,
																								Short.MAX_VALUE)
																						.addComponent(
																								formattedTextField,
																								GroupLayout.DEFAULT_SIZE,
																								171,
																								Short.MAX_VALUE))
																		.addContainerGap())
														.addGroup(
																Alignment.TRAILING,
																gl_panel_1
																		.createSequentialGroup()
																		.addComponent(
																				btnLogin,
																				GroupLayout.PREFERRED_SIZE,
																				142,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(56)))));
		gl_panel_1
				.setVerticalGroup(gl_panel_1
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								gl_panel_1
										.createSequentialGroup()
										.addGap(33)
										.addGroup(
												gl_panel_1
														.createParallelGroup(
																Alignment.TRAILING)
														.addComponent(
																formattedTextField,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(
																lblBenutzer))
										.addGap(12)
										.addGroup(
												gl_panel_1
														.createParallelGroup(
																Alignment.BASELINE)
														.addComponent(
																lblPassword)
														.addComponent(
																passwordField,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE))
										.addGap(39).addComponent(btnLogin)
										.addContainerGap(537, Short.MAX_VALUE)));
		panel_1.setLayout(gl_panel_1);

		panel_2 = new JPanel();
		tabbedPane_2.addTab("Verwaltung", null, panel_2, null);
		tabbedPane_2.setEnabledAt(1, false);
		list = new JList(new DefaultListModel());
		list.setFont(new Font("Verdana", Font.BOLD, 12));
		list.setBackground(SystemColor.textHighlightText);
		list.setVisibleRowCount(12);
		list.setValueIsAdjusting(true);

		JButton btnNewButton = new JButton("Ausf\u00FChren!");
		btnNewButton.setFont(new Font("Verdana", Font.BOLD, 12));
		btnNewButton.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				if (a > 0) {
					NameDialog nd = new NameDialog("");
					nd.setVisible(true);
					nd.setLocation(400, 300);
					String editName = nd.getName();
				}
			}
		});
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});

		JButton btnAuswahlLschen = new JButton("Auswahl l\u00F6schen!");
		btnAuswahlLschen.setFont(new Font("Verdana", Font.BOLD, 12));
		btnAuswahlLschen.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				l = ((DefaultListModel) list.getModel()).getSize();
				System.out.println("" + l);
				if (array.size() > 0) {
					for (int i = 0; i < l; i++) {

						array.get(i).setBackground(gruen);
						array.get(i).setBorder(
								BorderFactory.createLineBorder(col_lg, 3));
						array.get(i).setForeground(col_w);
						a = 0;
						;

					}
					System.out.println("" + array.size());
					((DefaultListModel) list.getModel()).removeAllElements();
					array.removeAll(array);
					System.out.println("" + array.size());

				}
			}
		});
		JRadioButton rdbtnReservieren = new JRadioButton("Reservieren");
		rdbtnReservieren.setSelected(true);
		buttonGroup.add(rdbtnReservieren);

		JRadioButton rdbtnStornieren = new JRadioButton("Stornieren");

		buttonGroup.add(rdbtnStornieren);

		JRadioButton rdbtnSperren = new JRadioButton("Sperren");

		buttonGroup.add(rdbtnSperren);

		JRadioButton rdbtnEntsperren = new JRadioButton("Entsperren");

		buttonGroup.add(rdbtnEntsperren);
		
		JRadioButton rdbtnBezahlt = new JRadioButton("Vergeben");
		buttonGroup.add(rdbtnBezahlt);
		GroupLayout gl_panel_2 = new GroupLayout(panel_2);
		gl_panel_2.setHorizontalGroup(
			gl_panel_2.createParallelGroup(Alignment.TRAILING)
				.addGroup(gl_panel_2.createSequentialGroup()
					.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
					.addComponent(btnNewButton, GroupLayout.PREFERRED_SIZE, 280, GroupLayout.PREFERRED_SIZE)
					.addContainerGap())
				.addGroup(gl_panel_2.createSequentialGroup()
					.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
					.addComponent(btnAuswahlLschen, GroupLayout.PREFERRED_SIZE, 280, GroupLayout.PREFERRED_SIZE)
					.addContainerGap())
				.addGroup(gl_panel_2.createSequentialGroup()
					.addGroup(gl_panel_2.createParallelGroup(Alignment.LEADING)
						.addComponent(rdbtnStornieren, GroupLayout.PREFERRED_SIZE, 92, GroupLayout.PREFERRED_SIZE)
						.addComponent(rdbtnReservieren, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel_2.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_panel_2.createSequentialGroup()
							.addComponent(rdbtnSperren, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE)
							.addGap(18)
							.addComponent(rdbtnBezahlt, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE))
						.addComponent(rdbtnEntsperren, GroupLayout.PREFERRED_SIZE, 97, GroupLayout.PREFERRED_SIZE))
					.addGap(19))
				.addComponent(list, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
		);
		gl_panel_2.setVerticalGroup(
			gl_panel_2.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel_2.createSequentialGroup()
					.addComponent(list, GroupLayout.PREFERRED_SIZE, 359, GroupLayout.PREFERRED_SIZE)
					.addGap(18)
					.addGroup(gl_panel_2.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_panel_2.createSequentialGroup()
							.addComponent(rdbtnReservieren)
							.addGap(3)
							.addComponent(rdbtnStornieren))
						.addGroup(gl_panel_2.createSequentialGroup()
							.addGroup(gl_panel_2.createParallelGroup(Alignment.BASELINE)
								.addComponent(rdbtnSperren)
								.addComponent(rdbtnBezahlt))
							.addGap(3)
							.addComponent(rdbtnEntsperren)))
					.addGap(18)
					.addComponent(btnNewButton, GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addComponent(btnAuswahlLschen, GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE)
					.addGap(77))
		);
		panel_2.setLayout(gl_panel_2);
		contentPane.setLayout(gl_contentPane);

	}

	class NameDialog extends JDialog implements ActionListener {
		private JButton okButton = null;
		private JButton cancelButton = null;
		private JTextField nameField = null;
		String name = null;
		private JTextField email = null;

		public NameDialog(String initName) {
			// super("Name Dialog", true);

			Container cp = getContentPane();
			cp.setLayout(new BorderLayout());

			cp.add("North", new JLabel("", SwingConstants.LEFT));

			JPanel inputPanel = new JPanel();
			inputPanel.setLayout(new GridLayout(3, 2));
			inputPanel
					.add(new JLabel(
							"Bitte geben Sie Ihren Namen und Ihre E-Mail-Adresse ein:"));
			inputPanel.add(new JLabel(""));
			nameField = new JTextField(initName, 20);
			email = new JTextField();
			inputPanel.add(new JLabel("Benutzer"));
			inputPanel.add(nameField);
			inputPanel.add(new JLabel("E-Mail"));
			inputPanel.add(email);

			cp.add("Center", inputPanel);

			JPanel buttonPanel = new JPanel();
			cp.add("South", buttonPanel);

			okButton = new JButton("Ok");
			okButton.addActionListener(this);
			buttonPanel.add(okButton);

			cancelButton = new JButton("Cancel");
			cancelButton.addActionListener(this);
			buttonPanel.add(cancelButton);

			pack();
		}

		public void actionPerformed(ActionEvent e) {
			if (e.getSource() == okButton) {
				name = nameField.getText();
				setVisible(false);
			}
			if (e.getSource() == cancelButton) {
				name = null;
				setVisible(false);
			}
		}

		public String getName() {
			return name;
		}
	}
}
